how instance recovery works