.
fixbug and add unittest for external func call