check if table exists before trying to grab column names