fix a bug: forgot to set index before retreiving data from  netcdf