improved show/hide of popups