#73, make the parallelN function exception safe