fix sending functionality