make pagination in home page work