use mutex for access to hash