update logout logic