fixed bug in dialog environments