added support for custom timeout on discovery