Fix code so no printing is done during async
removed old code and imporved comment