fix some issues with the database not initializing correctly