added file pattern parameter