sync UI to database