Adding an additional check on 401 errors before forcing a logout.