some refactoring
Fixed deserialization bug.
Added build with deserialization bugfix.