fixed window closing