Modified serialize