prevent dialogbox hide prematurely