maybe put the for loop and onFailure call into a try final block?