Fix all of the grammar problems in the given sentence:
To prevent such situations from happening, different governments in the developed nations have come up with policies to confront the challenges of an aging population.
To prevent such situations from happening, different governments of developed nations have come up with policies to confront the challenges of an aging population.