Edit before_action on messages_controller that was causing errors on recent and pending messages.