fix array issues