implemented the login and registration