add sort fields to query object