fix dialog callback too early