improve serializer encoding issue a bit