now writes json