added story and defect query, then sort