Fix for thread-unsafe map