fixed error when accessing toString() or hasOwnProperty()