modified server's send function
some changes