Fixing Dead store to local variable issue