add an option for overriding the directory to store the files