Changing mode of agent script