Fixed the flash overwrite bug in the flash storage