added code to handle 401 and 403 for ULS