array bounds fix