Fixing replacing the database