adding a directory for each pattern