fixed keypress recognition