Small fix in JS code for work properly with last API updates