Added try/catch for login