Added functionality for logging in