use history code's bug fix.
 last commit @emar.