fixed ag scripts