Make it work with prerendered modals