Add table existance detection for better error messages