set initialized flag before opening database