Fixed bug with updating a task and then adding a new one