add timeout logic for master client.