add the login and register function