revisit recovery code -- change so that keep a lock on the recovery