get rid of flicker when changing panes