fixed bug for db-updating