fix pattern construction from user input