add the functions of login and register