Fixing bug on esc