dont hide dialog too early