Added OnConnected and OnDisconnected events