JSON hack to avoid circular references