fixed the sorted filter