Added timeouts and disconnect