race condition removed by moving all hash operations into select guarded method