made iterating over hashmap in notification service thread safe