fix bug in update (to prevent modifying the actual task in the buffer directly)