Fixed JS code