add server discovery code