fix bug for setdata