Added missing JS code