fix for state cancel crash.