fixes multi-level nesting with multiple new nested objects

this fixes #1 (multi-level nesting with multiple nested objects created at one time)