service: don't walk out of bounds when checking services