Fixed issue that would crash on dismiss