Fixed send() function bug

send() function no longer randomly hangs.