fixing execution of template