fixed a bug that objects will not be updated instead they will be re-inserted in mysql.