wrap runtasks in an atomic transaction