add pattern protection