update ui and db