Make sure to close dialog