My program closes after I run a foreach code. [Answered] - C#