sort options according to the order