added clicking event, window will not fold if clicked once