implemented on_connect & on_disconnect
Merge branch 'on-connect'