added check for tables