Added form validation to register form