Fix to prevent double loading of layers

Set checked variable to false so it doesn't do the pop twice.

This workaround can also be used when closing modals and redirecting.