Fixed an api bug