wait returns a state now
error handling example update