add auto login & change mode of global variables