Print login failed error message once instead of twice