Added thread safe map and removed debug printing