Fixed authentication logic :D