respect sort_elements setting