fixing async issue