circular reference checking