Tried locking whole hash table, still does not work with > 1 threads running. Proposed solution commented out
Corrupted data replaced with original file