handle circular references