Thank you all for quick response and solutions.
1 thing that is bothering me is why the same logic is running on other machines and just having issue only on this machine and what is different in this machine that is causing the issue.
I am trying to find the root cause for this, but for the time being I have no other choice other than to apply the alternate fix in the code.
Thanks once again for the response.