update view when change state