extending demo,
bugfixing json writer