Fix sorting option in pagination