tweaked terms to pass id and remove null or blank values