Sorry i read the debug wrong, number of tagfieldtypes is giving an exception. typing this on my phone but here goes: fields[field_index].type>=0 && fields[field_index].type<NUMBER_OF_TAG_FIELD_TYPES