added existence of table check