Fixing 2 bugs
Bug 2: Remove part of script erratic, made the checkbox value robust to prevent further issues
Bug 3: Jobs wait loop made robust by adding check fro jobs still running. Now reads both pending and running to stay in loop