close dialog inside callback