Properly hide the window when animation complete