Js changes for #422

Required js changes for #422