fixing array issue