better check of existence of tables.
typo fix.