fixed bug with nested objects