detect circular references