fix hash serialization