context changed to dict for json serialization