replaced async.apply with closures