Add check for circular references issue #14