Rework the modal plugin