add recovery functionality