replace serialize method in Serializer with dump