Fixed a lot bugs of connection monitoring