separate send() function