Fix error message disappear, update counter only when needed.