I fixed the issue and attached the patch for the same.
Kindly review my patch.