make sure the database is ready