moved to getdata method