fix #2193

the most common reason of "Operation is not valid due to the current state of the object"