Fix bug where login controller would not be properly dismissed.