corrected async handling