changed Set to acquire write lock on entire hash before making any changes.
cleanup