fixed pagination issues in twig