edit bug for undo
optimised add and delete, use task instead of id