Update directive to be able to add leaf to json object