fix jquery modal bug

I guess this is why in real life I write tests everywhere for everything!