added support for prevtask. fixed also fork routine