Added recovery logic.