fix bug PaternManager.cs