Add commit count check to handlePatternMatchFail function