Modified waitOnDeployments function in control script