fix bugs when get data from db.