move resource table insertion out of async.parallel block