fixed bug in deserialization