add pattern validation