added destroy_messages function