Fixed programmatic dismiss