stringify output if it does not have a serialize method