cant repair d821 imei

Checking data…10/02/2016 10:14:53 م > OK
Platform: LG Qualcomm
Selected port: COM4
Selected model: D821
Reading info…
Initializing ADB…10/02/2016 10:15:04 م > OK
Waiting for phone…10/02/2016 10:15:06 م > OK
Model ID: Nexus 5
Firmware version:
Kernel version: 3.4.0-g88fbc66 ( (gcc version 4.7 (GCC) ) #1 SMP PREEMPT Mon Oct 20 22:18:31 UTC 201
Android version: 5.0
Hardware: Qualcomm MSM 8974 HAMMERHEAD (Flattened Device Tree) ARMv7 Processor rev 0 (v7l)
Switching to Fastboot mode…10/02/2016 10:15:21 م > OK
Unlocking Bootloader…
Bootloader is unlocked.
Writing Bootloader…10/02/2016 10:15:23 م > OK
Please, wait while the phone will turn on and press "Ok" button.
Trying to enable Diagnostics ports…
Initializing ADB…10/02/2016 10:16:21 م > OK
Waiting for phone…10/02/2016 10:16:22 م > OK
Checking root access…
Phone is already rooted.
Diagnostics ports are enbled!
Switching to Serial Port…
Failed! .

try to write anthoer firmware but still the same alwys failed switching to serial port .

any idea ???