fix timeout and blocking