fix db problems