Fix bug in updating items