send function reworked