made query async.