test for failure
more strict checks and reseting state
test for failure
fix