fix bug cause by refactoring api