update ui and save functionality