Attempt one at making sure database is open.
Changed to init database first