fixed some data bugs with history data