[COOK-3773] Fixing immediate restarts on template