Fix adding items to history