Added check for file count with given patterns