same for the if statement to fetch the service definition above the switch