fix timeout computation