serialization not working properly