How to fix System.ArgumentOutOfRangeException: error? - C#