fixes a bug when a service is null