added exception handling for when the service is not available