fixed AOE by replacing the old code