added check for fields