added key events and error checks of register form