Fix a javascript error with non continuous data