used self.temp_dir for tests