why do we need to hide and show the window here?