fix custom order type func