Update public/javascripts/TextProcessor.js

fix state machine issue