add smart_sort support