async bug in render.js