The pre-toolbarswitch editor instance was not fully removed with the previous code.
This caused java script errors on the removed instance when the editor was already replaced.
Therefore use the destroy function which does completely remove the old editor instance.