fixed legacy db compatibility