replace cast with redis serialize