corrected indentation
surrounded flashOff() with try-catch statement to fix some vague exceptions that cause crashes in random circumstances.