fix db issues