Fix Javascript so that having two buttons actually works