fix auto_logn & added flash