Fixed templates and catch exception