Added script autostart functionality