fixed naming of json to opt_json and elements to opt_elements