fixing context issue in bad build.js handler