Updated registration and login functionality