remove cursor on leave