update ui and database