[Panels] Fix closing of panels