Here are required steps before getting further programming help.
- Please make sure to verify forum account before. See here
- If you copy code from other sources then please insert credit into the copied code and with link if available.
- You have to read ApplyStop documentation.
- The code you posted and modified needs some restructure and additions.
Anyway it does work (as you expect it to work) after following steps 3. (and 4.) as you can see here
Again if you still struggle then please first verify user account.