added try/catch for aws