fix issue: toString() should use getName() instead of name field