add callback to print to know when it is completed