added mutex for matching