fix to js build function