fix a fatal bug

Bug description: Some data will be lost when store into mysql database.