Added configurable connection timeout and max retries