added getdata and clear data