changed return of send() from void to int