Add check for empty dataDicts in loops