esc event to free the cursor & fix player bugs