Add callback to print function