removing possibility of invalid chars
improve server existence check and ip exception.