updated js to read json values