Bugfix of serialize