fix incorrect array key assumption