open and close window fixes