add case when scalar is template param