added additional error handling for unauthorized service