add properly query to pagination