added keypress detection to submit