added  for toArray method, ref #90