fix timeout when wiating for a first connection