Fix UD behavior. State is destructed after changeState
Merge pull request #79 from ResidentBiscuit/rb-FixUDBehavior

Fix UD behavior. State is destructed after changeState