added profiles up to 594; error handling in emr script