fix pattern matches