fix bug with async