added error handling for execution in the cloud