add network change broadcast receiver, and bug fix.