add callback function to pause