fixed serialization and added coverage