[fix] TypeError: Object.defineProperties called on non-object (issue #166)

The original code doesn't really fix the issue #166 .