fix bug in numOfFieldsThread