如何修复Symfony中的“已存在数据”错误

I wish to add after serialization, the delivery date

so I created an event listener, with method "onPostSerialize".

here is my listener :

namespace App\ApiBundle\Serializer\Listener;

use JMS\Serializer\EventDispatcher\Events;
use JMS\Serializer\EventDispatcher\EventSubscriberInterface;
use JMS\Serializer\EventDispatcher\ObjectEvent;

class BrandListener implements EventSubscriberInterface
{
    public static function getSubscribedEvents()
    {
        return [
            [
                'event' => Events::POST_SERIALIZE,
                'format' => 'json',
                'class' => 'App\ApiBundle\Entity\Brand',
                'method' => 'onPostSerialize',
            ]
        ];
    }

    public static function onPostSerialize(ObjectEvent $event)
    {
        $object = $event->getObject();

        $date = new \Datetime();
        $event->getVisitor()->addData('delivered_at', $date->format('l jS \of F Y h:i:s A'));
    }
}

even when emptying the cache, I have an error that tells me that a data has the same name (except that no)...

Here the error Symfony:

InvalidArgumentException There is already data for "delivered_at"

.