removed bug with circular references