FIX the bug in GreedyMatch