fixed a bug dealing with loading data