Modified messages_controller