Fix crash in newtask