fix timeout + state inversion