Add timeout to connection opening