Submit functionality added to register method