change dialog opening to intermediatOpenHandler