Fixed flickering of dialog boxes