array negative index fix