Update logic