fix annoying db problems