Fix error when retrying failed requests