Fix issue when calling function based tasks