asyncWait to clean up main.js