Adding ap recovery to loop