handle error on json Marshal
Update to allow use of instance roles