added keypress event handler