error handling for ami create script