fixing esc key bug