add flag for connecting state
fix bugs for displaying progress;add notify for connection state changed;