added ordering to query