Added initial authentication logic