updated addData checks now if the first data is an array