add hooks to clean string values before generating JSON