added check for pagination template