correcting behaviour of dialog