- workaround for uncaught_exception issue - avoid mutating vector while iterating it (due to re-entrancy)