fix js for new format