deep copy parent scope object, fixes #17