Add additional conditions for sorting