Added check if table exists