 => {
                        // Clear animation
                        this.style.animation = '';
                        
                        if (xhr.status === 200) {
                            try {
                                const response = JSON.parse(xhr.responseText);
                                
                                if (response.status === "ok") {
                                    // Toggle the button state
                                    const newState = !isActive;
