bug fix in logout rm function