Fixed traverse function definition