fix qr Scanner crashing the app on dismissviewcontroller