Toast dialog and exit logic

Fixes #382