fixed graph template class bug