fixed variable scope