agent script fix