fix reentrant aborting in loops