fix for std::map delete memory leak