fix ordering of tasks