added event handlers for enter key