if login failed then return null