fix array bounds