add submit method. typing enter to trigger submit method.