Replacing js code