fix some bug in logout