Bug fixes on adding/removing connection history