Passing in a callback to the task definition function