four version of serialize