making the equals method work when the obj graph has circular dependencies