Added missing JS code back