fixed windows closing and opening