click to close or press esc key