fixed database initialization bug