fix bug when servername is empty