add callback when connection is established