fixed variable bugs