Crook's corps was attached to Major General David Hunter's Army of the Shenandoah and soon back in contact with Confederate forces, capturing Lexington, Virginia on June 11.[63] They continued south toward Lynchburg, tearing up railroad track as they advanced,[63] but Hunter believed the troops at Lynchburg were too powerful, and Hayes and his brigade returned to West Virginia.[63] Hayes thought Hunter lacked aggression, writing in a letter home that "General Crook would have taken Lynchburg."[63] Before the army could make another attempt, Confederate General Jubal Early's raid into Maryland forced their recall to the north. Early's army surprised them at Kernstown on July 24, where Hayes was slightly wounded by a bullet to the shoulder.[64] He also had a horse shot out from under him, and the army was defeated.[64] Retreating to Maryland, the army was reorganized again, with Major General Philip Sheridan replacing Hunter.[65] By August, Early was retreating up the valley, with Sheridan in pursuit. Hayes's troops fended off a Confederate assault at Berryville and advanced to Opequon Creek, where they broke the enemy lines and pursued them farther south.