made access to hashmap thread-safe via mutex