added check for table count field