updated AMI
change termination condition to check age of newest file