prevent InvalidOperationException