added sub_directory option