test serialize functionality