fix db and index