apply task only when template is active