fixed material traversal function