adjust modal function.