fix javascript for new data-format