add ajax to pagination
refactor last commit