-added variables to ami run
-better error check with ami run