Tested it a lot of times but still giving unexpected error - C#