Modified the js function to check if one field is returning null or an empty string