fix bug with history