You can't export a function to a json string, convert it to a string so it can be stored, this isn't the safest choice but I see no alternative