fix logout fatal error