fixed template specialization issues