Catch errors when last shown dialog is not showing any more