set up flash module to gracefully handle errors