fixed a bug in setData()