Fixing layer priority in the popup + destroy method