add login and register functions