Updated recovery middleware to use ChainLink technique