updated the registration functionionality with some bug fixes and cross site request forgery protection