fixed serialisation of json