add dynamic named scope for sorting