fixes js button switch