apply fix to send function bug

The latest PR caused a minor bug in the send function.