fix the bugs in flashDB.js