Error in class traversal