Added logon logic