Fixing bug related to history