Fix bug where wrong task is updated/deleted