fix performance bottlebeck of findFirstMatch for real