fix pattern parsing