fix pattern loading