Use sys_get_temp_dir() instead of hardcoded directory