added type attr to nodes