deal with null ids