created tmp_path variable before foreach