fix pages sorting