added keypress event functionality