     }
 	
 	private func getSuggestedWords() -> (completions: [String], gussess: [String])? {
+		print(currentWord)
+		if currentWord == "" {
+			return ([], [])
+		}
 		let textChecker = UITextChecker()
 		let range = NSRange(location: 0, length: currentWord.characters.count)
 		let completions: [String] = textChecker.completions(forPartialWordRange: range, in: currentWord, language: "en_US")!

		} else if !hasAssessedEmotion && keepUsingTime > keepUsingThreshold {
            
            createOverlay()

//			promptAssessmentSheet()
            // Do this in view did disappear//
//            if let components = textDocumentProxy.documentContextBeforeInput?.components(separatedBy: " "){
//                print ("sentence in switchAssesmentState is", components)
//                let sentAfterPam = getSentiment(wordArr: components)
//                print ("sentiment in has switch assessment state", sentAfterPam)
//            }
//            

		}
		defaults.set(Date(), forKey: KeymochiKeyboardViewController.kLastOpenTime)
	}

        let keyEvent = BackspaceKeyEvent()
        keyEvent.downTime = CACurrentMediaTime()
        backspaceKeyEvent = keyEvent
		if let word = textDocumentProxy.documentContextBeforeInput?.components(separatedBy: CharacterSet(charactersIn: " \n")).last! {
			currentWord = word
			if currentWord != "" {
				currentWord.remove(at: currentWord.index(before: currentWord.endIndex))
			}
