use another method to close window