fix template bug only found by gcc