fixed serialization bug

#191