changed dump method and fixed a bug on type of the root node