implement connection callback functionality