solved some bugs with loading history