small bug in template implementation