using keypress instead of blur