manually serialize