added user registration and login functions