fixes to make db work