Fix a bug in changing object property