fix custom elem sort and add option override