fixes dump messages function