added check for valid field