Fixes #45 Quitting crashes the app sometimes