fixed type cast on template call