handle authorization error, fixes #37