Pattern validation fix