Fix legacy api bug