why did the battle of yorktown happen?