enchancment of MessageController.php