update db and fix some error