Fixed setting of login flag