BTT Remote - Close window not working?

I am trying to set up a BTT Remote Action, with just a little bit of difficulty.

I often watch TV shows at night, and would like an action that does the following:

  1. Presses escape (to get out of full screen view)
  2. Closes the current Safari window (so the show closes)
  3. Sleeps my display

I set this up, but BTT never closes the window. I tried two different ways:


In both cases, the window does not close, and the show keeps playing, even after the third action to sleep display is triggered.

The closest I've some to getting this to work is:

This is not ideal, as I have Safari set to launch with whatever was open when last quit. In other words, the next morning Safari would open with my TV show from the night before.

Hopefully I'm missing something easy here. Any thoughts or help is appreciated!

For anyone who stumbles upon this, I figured this out.

@Andreas_Hegenberg's comment in this thread was especially helpful. Also the others who suggested adding a delay.

Here is my finished combination: