add login and register method