added on_connect handler