updated enter key handling