Added logic for login error