added internal findpattern