fix of default template and error catching