pattern recognition fix