Replace invoke with depentent task