Close modal window after creating a stack