fixed a bug for non-ex. patterns.