move localforage init to db