fixed legacy bugs