getdata function defination