fixing the array addition