bug exists if a top-level object is undefined
Merge pull request #118 from gterrono/fixed-undefined-object-bug

bug exists if a top-level object is undefined