Adds recover callback to handle error recovery