add close/remove modal function