added login and registering functionality