BUGFIX: statechanged listener now not fired twice