better handling for errors in theming