Fixing Authentication

I was unable to authenticate, with your code, please check my fix.