database update
base logic