fixed sorting clauses