Fixed window.close() not working