implemented the connection build_reply function