Fixed bug when creating new task crash