add loop to getdata