safety check for null ids