fix timeout check