fixed an infinite loop in ns_recover, caused by a very small typo.