tweaks to generate script async logic