added media_temp_local_dir checking