updated automation script