close popup before opening confirmation