update code for loading data