added sendServer() common function