fixes error in loading data