added opts to get data and get local data