Fix scp retry bug