Order rows before pagination in order to the eliminate deprecation warning