fix redirect to login when 401 error