Fix tainted variable access issue