Modifying js to match server