added registration and login functionality