updated angularjs sentence reset logic and keypress event handling