fix reverse ordering of tasks