Fixed bug in loading data