Catch InvalidOperationException as well