fixes problem with ESC and ENTER