# Cast error when Typed Persistence Actor received Old Commands

**URL:** <https://discuss.akka.io/t/cast-error-when-typed-persistence-actor-received-old-commands/9031>\
**Category:** Uncategorized\
**Created:** [November 9, 2021, 5:23am UTC](https://discuss.akka.io/t/cast-error-when-typed-persistence-actor-received-old-commands/9031 "2021-11-09T05:23:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maroon\_2016](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@maroon\_2016](https://discuss.akka.io/u/maroon_2016)\
**Post date:** [November 9, 2021, 5:23am UTC](https://discuss.akka.io/t/cast-error-when-typed-persistence-actor-received-old-commands/9031/1 "2021-11-09T05:23:19Z")

</div>

Hi,

We’re trying to do a rolling update which involve an old typed persistence actor and a new typed persistence actor. We have implemented them totally independent from each other and has independent command, events, state and reply classes.

The problem is when we do a rolling update from a version with the old typed persistence actor to a version with the new old typed persistence actor, we’ve encountered a casting error.

My question is, if there’s away to intercept the old command message on the new typed persistence actor before casting it to the new command message?
