fixing localhost in JS