added support for circular references for hash