handle authentication failures better