Fixed reference to local variable