Added chg detection in JS