Working version with async.