fix error variable access