call login and register functions