fixing type of array bug