added registration and login function