close on exception during iterating