checking valid state and outcome