Added functionality for login and registration