added will_connect and will_disconnect