Manage states scripts rewritted, close issue #65