check for valid service before iterating