add if statement to check whether the sampleFiles is empty