adding type method to nodes