Add a serializer for messages