Object that's passed in isn't recognized as an object? - C#