fix logout and dublicate messages