Modified JS code