added sort in addition to filter