fix a regression which causes crash (template parameter changed)