adapted js to new data schema