properly load and save the hashes in file