FIxed file issue.
Made sure the retried state is saved somewhere.