Fixed problem when too many tries are attempted with a small dictionary
Saving the index for subsequent invocations