fix for closing windows