implementing message send functionality