Fixed small bug with history recording