updated register for proper login and url redirection