Added shortcircuit if context not set
Fixed bug in addJson