Close the app after nfc action and add a try catch