added custom_directory option