The script had two of those trap lines, one global near the top, and a second one inside a sub function. Removing the latter made the script exit as/when required for me, but I don't fully understand what you expect from it. smile