I'm working on an automated slide setup and depending on some opt-out variables I need to remove some of the slides if they are not desired in the final output. To solve this I have created a script that adds a simple text string `{{remove-this-slide}}` to the slides that need to be deleted.

However, when trying to get a script to delete the slides containing that string it keeps deleting my entire presentation...

This is what I have:

```
function deleteFunction() {
var currentPresentationSlide = SlidesApp.getActivePresentation().getSlides();
  for (i = 0; i < currentPresentationSlide.length; i++) {
    if (currentPresentationSlide[i].getPageElements().indexOf('{{remove-this-slide}}') > -1); {
    currentPresentationSlide[i].remove();
  }
 }
}

```

Can anyone figure out what's going wrong here?