Fix login problem of loading twice.