adding null check for sampleId