added code for client discovery