fixed index to properly send over json