Added parameter for passing task to callbacks