improved handling of emtpy fields and null values