Fix bug on change state to final