Fix compilation failure

Fix failure of compilation caused by referring to an inaccessible local variable.
Resolve compilation issue

Actually resolve the compilation issue instead of just wallpapering over it.