handle json serialisation errors better and prevent them for record.args