implemented client side validation of reg form