reverted to one indexing, it was correct. removed the line which dereferenced fields[10]