fix database stuff