problem testing equality in template for some reason