fixed nullpointerexception in ptask