You are seeing one of the problems with using locals and globals, the race condition. There is nothing that synchronizes the loop that contains the stop button and the one that has the local. When you press the stop the other loop may be anywhere in its execution and will complete that before reading the button. Also, with loops, they will execute once, regardless of the conditon of their stop flag.
You should not create a new thread for the same problem when you have a change to the message, like adding a file. Just continue in the original thread, even if it is a somewhat divergent question. Those of us trying to help you may scan for new questions in threads we are following and miss your "new" posting when you create a new thread.
P.M.
PutnamCertified LabVIEW Developer
Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5

LabVIEW Champion