Controllers/MessagesController.cs: modified