fix bug when adding task