fixes multi-level nesting with multiple new nested objects

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