By the way, if you are just trying to pause something until the view closes, you would use wait_modal instead.