fix bug in logout