waits for environment to terminate and adds dont-wait option