fixed variable bug