Fixed a bug where the apps crash when quiting the scanner-app