According by the indentation, the "serialize" function is nested in the "object_convert" function.
Are your sure that ```serialize``` is available from outside of the object_convert?