add login and register function