Fixes dialog behavior