updated js to match latest changes in master branch