fixed bug in logout