Fix bug that can not update database