fixed bug in deserialization of metadata