fixed variable array issues