ADDS function to check that table exists