prevent circular reference in JSON causing infinite loop