added setData function