fixed pagination in template