added rescue to authentication