add sorting to pages