fix #3980: re-initialize sort order after switch to history