Fixed problem while serializating data to the cache