moved from keypress to enter