Correct sorting in getAll