     }
     
 	func start(context: Context) -> Bool {
-		guard !started(in: context.chatId) else {
+        guard let chatId = context.chatId else { return false }
+        
+		guard !started(in: chatId) else {
             context.respondAsync("@\(bot.username) already started.")
             return true
         }
-        startedInChatId.insert(context.chatId)
+        startedInChatId.insert(chatId)
         
         var startText: String
         if !context.privateChat {

router["reverse", .slashRequired] = controller.reverseText
router["word_reverse"] = controller.reverseWords
// Default handler
router.unknownCommand = controller.reverseText
// If command has unprocessed arguments, report them:
router.partialMatch = controller.partialMatchHandler


    }
    
	func stop(context: Context) -> Bool {
        guard let chatId = context.chatId else { return false }

        guard started(in: chatId) else {
            context.respondAsync("@\(bot.username) already stopped.")
            return true
        }
		startedInChatId.remove(chatId)
		
        context.respondSync("@\(bot.username) stopped. To restart, type /start")
		return true
    }
    
	func help(context: Context) -> Bool {
		guard let from = context.message?.from else { return false }
        let helpText = "What can this bot do?\n" +
            "\n" +
            "This is a sample bot which reverses sentences or words. " +
