fix bugs in core api