fix bug in recovery