avoid flickering with auto switch of panels