fix up database