Fix serializer to work for custom fields