fixed data buffer scope issue and always forward sorted get_range due to std::map