implemented login and register