fixed indexoutofboundsexception in ptask and ftask