fix bug when logged