Made the indexing safer when the JSON is too big