Why was Frederick able to retreat successfully?