fixed legacy code