implemented user registration and login