Adjust open modal function