fix pane overlay logic