fixing serialization stuff