remove mask and window after close