update index to be valid js