Added pattern validation