update object.js. fix logic error