Fixed Automation Script by Herbert