fix has_order logic